package com.ysq.www.api.user.mapper;

import com.ysq.www.api.user.entity.Collect;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 收藏记录表 Mapper 接口
 * </p>
 *
 * @author dql
 * @since 2020-08-18
 */
public interface CollectMapper extends BaseMapper<Collect> {

    /**
     * 查询收藏记录
     * @param contentId 内容id
     * @param userId 用户id
     * @param type 类型：1资讯，2活动
     * @return Collect
     */
    @Select("select * from t_collect where status = 0 and content_id = #{contentId} and user_id = #{userId} and type = #{type}")
    Collect selectCollectById(Integer contentId, Integer userId,Integer type);
}
